<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html"><head>
    <meta charset="utf-8">
    <title>{include file="common/title"}</title>

    <meta name="description" content="Dashboard">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__DATA__/admin/style/bootstrap.css" rel="stylesheet">
    <link href="__DATA__/admin/style/font-awesome.css" rel="stylesheet">
    <link href="__DATA__/admin/style/weather-icons.css" rel="stylesheet">

    <!--Beyond styles-->
    <link id="beyond-link" href="__DATA__/admin/style/beyond.css" rel="stylesheet" type="text/css">
    <link href="__DATA__/admin/style/demo.css" rel="stylesheet">
    <link href="__DATA__/admin/style/typicons.css" rel="stylesheet">
    <link href="__DATA__/admin/style/animate.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__DATA__/admin/css/style-1.css">

</head>
<body>
<!-- 头部 -->
{include file="common/top"}
<!-- /头部 -->

<div class="main-container container-fluid">
    <div class="page-container">
        <!-- Page Sidebar -->
        {include file="common/left"}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li class="active">控制面板</li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->

            <!-- Page Body -->
            <!--正文-->

            <div class="page-body">
                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="widget">
                            <div class="widget-body">
                                <div class="flip-scroll">
                                    <table class="table table-bordered table-hover">
                                        <thead class="">
                                        <tr>

                                            <th class="text-center">发起时间</th>
                                            <th class="text-center">餐桌类型</th>
                                            <th class="text-center">预约联系人</th>
                                            <th class="text-center">预留电话</th>
                                            <th class="text-center">预约时间</th>
                                            <th class="text-center">预约日期</th>
                                            <th class="text-center">状态</th>
                                            <th class="text-center">操作</th>

                                        </tr>
                                        </thead>
                                        <tbody>
                                        {volist name="data" id="v"}
                                        <tr>
                                            <td align="center">{$v.posttime}</td>
                                            <td align="center">{$v.quyu}</td>
                                            <td align="center">{$v.name}</td>
                                            <td align="center">{$v.tel}</td>
                                            <td align="center">{$v.ymd}</td>
                                            <td align="center">{$v.time}</td>


                                            {switch name="v.static"}

                                            {case value="1"}
                                                <td align="center" style="color: indianred;">待处理</td>
                                            {/case}

                                            {case value="2"}
                                                <td align="center" style="color: indianred;">未通过</td>
                                            {/case}
                                            {case value="3"}
                                                <td align="center" style="color: indianred;">已通过</td>
                                            {/case}
                                            {/switch}
                                            {switch name="v.static"}

                                            {case value="1"}

                                            <td align="center"><a class="btn btn-primary btn-sm shiny" href="{:url('business/order/yuyue_update',['id' => $v.id,'static'=>3])}">  <i class="fa fa-edit"></i>接受</a><a class="btn btn-success btn-sm shiny" href="javascript:showDialog()">  <i class="fa fa-edit"></i>拒绝</a></td>


                                            <form class="form-horizontal" role="form" action="{:url('business/order/yuyue_do_update')}" method="post" enctype="multipart/form-data">
                                               <div class="ui-dialog" id="dialogMove" onselectstart='return false;'>
                                                    <div class="ui-dialog-title" id="dialogDrag"  onselectstart="return false;" >
                                                        拒绝缘由
                                                        <a style="margin-left: 250px;" href="javascript:hideDialog();">x</a>
                                                    </div>
                                                    <div class="ui-dialog-content">
                                                        <div class="ui-dialog-l40 ui-dialog-pt15">
                                                            <input class="ui-dialog-input ui-dialog-input-username" name="jujue" type="input" placeholder="请输入..." />
                                                        </div>
                                                            <input type="hidden" name="static" value="2">
                                                            <input type="hidden" name="id" value="{$v.id}" placeholder="">
                                                        <div class="ui-dialog-l40">

                                                        </div>
                                                        <div>
                                                            <button  class="ui-dialog-submit" href="#" >确定</button>
                                                        </div>

                                                    </div>
                                                </div>

                                                </form>

                                            {/case}


                                            {case value="2"}

                                            <td align="center"><a class="btn btn-primary btn-sm shiny" href="{:url('business/order/yuyue_delete',['id' => $v.id])}">  <i class="fa fa-edit"></i>删除</a></td>

                                            {/case}
                                            {case value="3"}

                                            <td align="center"><a class="btn btn-primary btn-sm shiny" href="{:url('business/order/yuyue_delete',['id' => $v.id])}" >  <i class="fa fa-edit"></i>删除</a></td>

                                            {/case}

                                            {/switch}

                                        </tr>
                                        {/volist}
                                        <!-- Modal -->
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!--Basic Scripts-->
                <script type="text/javascript">
        var dialogInstace , onMoveStartId;  //  用于记录当前可拖拽的对象

        // var zIndex = 9000;

        //  获取元素对象
        function g(id){return document.getElementById(id);}

        //  自动居中元素（el = Element）
        function autoCenter( el ){
            var bodyW = document.documentElement.clientWidth;
            var bodyH = document.documentElement.clientHeight;

            var elW = el.offsetWidth;
            var elH = el.offsetHeight;

            el.style.left = (bodyW-elW)/2 + 'px';
            el.style.top = (bodyH-elH)/2 + 'px';

        }

        //  自动扩展元素到全部显示区域
        function fillToBody( el ){
            el.style.width  = document.documentElement.clientWidth  +'px';
            el.style.height = document.documentElement.clientHeight + 'px';
        }

        //  Dialog实例化的方法
        function Dialog( dragId , moveId ){

            var instace = {} ;

            instace.dragElement  = g(dragId);   //  允许执行 拖拽操作 的元素
            instace.moveElement  = g(moveId);   //  拖拽操作时，移动的元素

            instace.mouseOffsetLeft = 0;            //  拖拽操作时，移动元素的起始 X 点
            instace.mouseOffsetTop = 0;         //  拖拽操作时，移动元素的起始 Y 点

            instace.dragElement.addEventListener('mousedown',function(e){

                var e = e || window.event;

                dialogInstace = instace;
                instace.mouseOffsetLeft = e.pageX - instace.moveElement.offsetLeft ;
                instace.mouseOffsetTop  = e.pageY - instace.moveElement.offsetTop ;

                // instace.moveElement.style.zIndex = zIndex ++;
            })

            return instace;
        }

        //  在页面中侦听 鼠标弹起事件
        document.onmouseup = function(e){

            dialogInstace = false;
            clearInterval(onMoveStartId);

        }

        //  在页面中侦听 鼠标移动事件
        document.onmousemove = function(e) {
            var e = e || window.event;
            var instace = dialogInstace;
            if (instace) {

                var maxX = document.documentElement.clientWidth -  instace.moveElement.offsetWidth;
                var maxY = document.documentElement.clientHeight - instace.moveElement.offsetHeight ;

                instace.moveElement.style.left = Math.min( Math.max( ( e.pageX - instace.mouseOffsetLeft) , 0 ) , maxX) + "px";
                instace.moveElement.style.top  = Math.min( Math.max( ( e.pageY - instace.mouseOffsetTop ) , 0 ) , maxY) + "px";
            }
            if(e.stopPropagation) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
        };

        //  拖拽对话框实例对象
        Dialog('dialogDrag','dialogMove');

        function onMoveStart(){

        }


        //  重新调整对话框的位置和遮罩，并且展现
        function showDialog(){
            g('dialogMove').style.display = 'block';
            g('mask').style.display = 'block';
            autoCenter( g('dialogMove') );
            fillToBody( g('mask') );
        }

        //  关闭对话框
        function hideDialog(){
            g('dialogMove').style.display = 'none';
            g('mask').style.display = 'none';
        }

        //  侦听浏览器窗口大小变化
        //window.onresize = showDialog;
    </script>
            <script src="__DATA__/admin/style/jquery_002.js"></script>
            <script src="__DATA__/admin/style/bootstrap.js"></script>
            <script src="__DATA__/admin/style/jquery.js"></script>
            <!--Beyond Scripts-->
            <script src="__DATA__/admin/style/beyond.js"></script>

            <script>
                $(function(){
                    $('.dingdan').css('display','block');
                });
            </script>

</body></html>